//
//  NSDateFormatter+XDExt.m
//  HuaNong
//
//  Created by XiaoDev on 2020/9/27.
//  Copyright © 2020 Xiaodev. All rights reserved.
//

#import "NSDateFormatter+XDExt.h"

@implementation NSDateFormatter (XDExt)
- (void)xd_setDianyyyyMMdd {
  if (![self.dateFormat isEqualToString:@"yyyy.MM.dd"]) {
       [self setDateFormat:@"yyyy.MM.dd"];
    }
}
- (void)xd_setAllFormat {
    if (![self.dateFormat isEqualToString:@"yyyy-MM-dd HH:mm:SS"]) {
       [self setDateFormat:@"yyyy-MM-dd HH:mm:SS"];
    }
}
- (void)xd_setyyyyMMdd {
    if (![self.dateFormat isEqualToString:@"yyyy-MM-dd"]) {
       [self setDateFormat:@"yyyy-MM-dd"];
    }
}
- (void)xd_setyyyyMMddHHmm {
    if (![self.dateFormat isEqualToString:@"yyyy-MM-dd HH:mm"]) {
       [self setDateFormat:@"yyyy-MM-dd HH:mm"];
    }
    
}
- (void)xd_setNianYueRi {
    if (![self.dateFormat isEqualToString:@"yyyy年MM月dd日"]) {
       [self setDateFormat:@"yyyy年MM月dd日"];
    }
    
}
@end
